package com.dc.dao;

import com.dc.entity.ConfigEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;

public interface ConfigDao extends JpaRepository<ConfigEntity, Long>, JpaSpecificationExecutor<ConfigEntity> {

    public ConfigEntity findByYearAndName(int year, String name);

    public List<ConfigEntity> findByYear(int year);

    @Modifying
    @Transactional
    public void deleteByYear(int year);
}
